package com.icloud.article.boot.controller.admin;

import com.icloud.article.boot.dto.AdminDiscussPageDto;
import com.icloud.article.boot.service.DiscussService;
import com.icloud.article.boot.vo.AdminDiscussVo;
import com.icloud.common.core.api.CommonResult;
import com.icloud.common.web.vo.PageVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Api(tags = "后台评论接口")
@RequestMapping("/admin/discuss")
@RequiredArgsConstructor
public class AdminDiscussController {
    private final DiscussService discussService;

    @ApiOperation("分页查询评论列表")
    @PostMapping("/page")
    public CommonResult<PageVO<AdminDiscussVo>> discussPage(@Validated @RequestBody AdminDiscussPageDto dto){
        return CommonResult.success(discussService.discussPage(dto));
    }
}
